Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Making watch work with read_namespaced_pod_log #93

Merged
merged 3 commits into from
Mar 14, 2019

Conversation

mitar
Copy link
Contributor

@mitar mitar commented Oct 16, 2018

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 16, 2018
@mitar
Copy link
Contributor Author

mitar commented Oct 16, 2018

/assign @mbohlool

@codecov-io
Copy link

codecov-io commented Oct 16, 2018

Codecov Report

Merging #93 into master will increase coverage by 0.18%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
+ Coverage   92.11%   92.29%   +0.18%     
==========================================
  Files          13       13              
  Lines        1217     1246      +29     
==========================================
+ Hits         1121     1150      +29     
  Misses         96       96
Impacted Files Coverage Δ
watch/watch_test.py 98.7% <100%> (+0.18%) ⬆️
watch/watch.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2ac885...972a76a. Read the comment docs.

@yliaog
Copy link
Contributor

yliaog commented Oct 16, 2018

please add a test case for this.

resp.close()
resp.release_conn()
if self.resource_version is not None:
kwargs['resource_version'] = self.resource_version
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the else: break here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The log streaming does not have resource_version. So once the response finishes, you have to stop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact that was not good because using break inside finally swallows up the exception. I change it to setting a flag.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 19, 2019
@mitar
Copy link
Contributor Author

mitar commented Feb 19, 2019

@yliaog I have added tests.

@micw523 Please review and maybe merge this?

@micw523
Copy link
Contributor

micw523 commented Feb 20, 2019

As much as I want to merge this I don't have ownership of this repo :)
/lgtm
/cc @roycaihw

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 20, 2019
It swallows exceptions.
@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 21, 2019
@roycaihw
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 14, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mitar, roycaihw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 14, 2019
@k8s-ci-robot k8s-ci-robot merged commit c4de8bd into kubernetes-client:master Mar 14, 2019
@mitar mitar deleted the watch_and_logs branch March 14, 2019 22:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants